import redis
class Config(object):
    DEBUG=True
    SECRET_KEY="21312jjofoowqe"
    HOST="0.0.0.0"
    #fastdfs
    FDFS_ADDR="192.168.142.130:8888/"
    #数据库
    SQLALCHEMY_DATABASE_URI="mysql://root:mysql@192.168.142.130/cou3"
    SQLALCHEMY_TRACK_MODIFICATIONS=True

    #身份证正则
    ID_RE="^[1-9]\d{5}(18|19|20|(3\d))\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$"
    #redis
    REDIS_HOST="192.168.142.130"
    REDIS_PORT=6379
    MAX_CONTENT_LENGTH=50* 1024 * 1024
    #flask-session配置
    SESSION_TYPE="redis"
    SESSION_REDIS=redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    SESSION_USE_SIGNER=True
    PERMANENT_SESSION_LIFETIME=3600*24
class Development_env(Config):
    LOCAL_HOST="127.0.0.1"
    PORT=5000
class Product_env(Config):
    DEBUG=False
    LOCAL_HOST="120.24.37.147"
    PORT=8081
    SQLALCHEMY_DATABASE_URI="mysql://root:123456@120.24.37.147/cou3"
    REDIS_HOST="120.24.37.147"
    REDIS_PORT=6379
    SESSION_REDIS=redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT)


ConfigMap={
    'development':Development_env,
    'product': Product_env
}